package com.sun.init;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;


/**
 * 容器初始化完成后能执行
 * ApplicationRunner,CommandLineRunner,ServletContextAware,ServletContextListener
 * InitializingBean  @PostContruct
 */

@Slf4j
@Component
public class SystemInitExcetor implements ApplicationRunner, Ordered {
    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info(">>>>>>>>>>>>>容器初始化完成后加载>>>>>>>>>>>>>>>>>>>>>>>>>");
        System.out.println("                                                              \n" +
                "                                .::::.                        \n" +
                "                              .::::::::.                      \n" +
                "                              :::::::::::                     \n" +
                "                              ':::::::::::..                  \n" +
                "                               :::::::::::::::'               \n" +
                "                                ':::::::::::.                 \n" +
                "                                  .::::::::::::::'            \n" +
                "                                .:::::::::::...               \n" +
                "                               ::::::::::::::''               \n" +
                "                   .:::.       '::::::::''::::                \n" +
                "                 .::::::::.      ':::::'  '::::               \n" +
                "                .::::':::::::.    :::::    '::::.             \n" +
                "              .:::::' ':::::::::. :::::      ':::.            \n" +
                "            .:::::'     ':::::::::.:::::       '::.           \n" +
                "          .::::''         '::::::::::::::       '::.          \n" +
                "         .::''              '::::::::::::         :::...      \n" +
                "      ..::::                  ':::::::::'        .:' ''''     \n" +
                "   ..''''':'                    ':::::.'                      ");
    }

    @Override
    public int getOrder() {
        return -1;
    }
}
